import { getHttp } from "../common/http";
// export interface xx {
//     id: string;
//     order: number;
//   }
export async function getCourse(upId: string, typekeyword: string) {
  const http = getHttp();
  return await http(`course/${upId}/course-type-key/${typekeyword}`, {
    method: "get",
    // params:{
    //   keyword:keyword
    // }
  });
}

export async function getSentence() {
  const http = getHttp();
  return await http(`course/sentence`, {
    method: "get",
  });
}

export async function getCourseDetail(courseId: string) {
  const http = getHttp();
  return await http(`course/detail/${courseId}`, {
    method: "get",
  });
}

export async function getCourseKey(keyword: string) {
  if (keyword === "") return;
  const http = getHttp();
  return await http(`course/keyword/${keyword}`, {
    method: "get",
  });
}
